<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ include file="../commons/head.jsp"%>
<script src="${base }/js/class/input.js"></script>
<style type="text/css">
.SJ_Table td {
	background: none;
}
</style>


<%-- 判断是新增，还是更新 --%>
<s:set name="add" value="id==null? true : false" />

<s:set name="title">
	<s:if test="add">
添加班级
</s:if>
	<s:else>
修改班级
</s:else>

</s:set>
<div class="Title">
	<h1>
		${title }
	</h1>
</div>
<%-- 如果是新增，form提交到add Action --%>
<s:set name="formAction">
	<s:if test="add">
		<s:url action="add" />
	</s:if>
	<s:else>
		<s:url action="update" />
	</s:else>
</s:set>
<form action="${formAction}" method="post" id="form1">
	<!-- 增加之后，返回到能看到新增记录的页面 -->
	<s:if test="add">
	</s:if>
	<s:else>
		<%--如果是修改，返回原来页 --%>
		<input type="hidden" name="lastPage" value="${lastPage }" />
		<input type="hidden" name="bean.id" value="${id}" />
	</s:else>
	<table class="SJ_Table Tcenter" width="100%" border="0"
		style="background: none; margin-top: 10px">
		<tr>



			<td align="right">
				名称：
			</td>
			<td align="left">
				<input type="text" name="bean.name" value="${bean.name}">
			</td>
		</tr>
		<tr>
			<td align="right">
				入学年份：
			</td>
			<td align="left" id="bean_matriculationYear_td">
			</td>
		</tr>

		<tr>
			<td align="right">
				学制：
			</td>
			<td align="left">

				<select name="bean.totalLearnYear" id="bean_totalLearnYear">
					<option value="1">
						1
					</option>
					<option value="2">
						2
					</option >
					<option value="3" >
						3
					</option>
					<option value="4">
						4
					</option>
					<option value="5">
						5
					</option>
				</select>
			
			</td>
		</tr>
		<tr>
			<td align="right">
				专业：
			</td>
			<td align="left">
				<%--获取专业列表 --%>
				<s:action name="taglist" namespace="/speciality" var="specialityAct" />

				<select name="bean.speciality.id">
					<s:iterator value="#specialityAct.page.list">

						<option value="${id}"
							<s:if test="id == bean.speciality.id">selected="selected"</s:if>>
							${name}
						</option>
					</s:iterator>
				</select>

			</td>
		</tr>

		<tr>
			<td align="right">
				<input type="submit" value="提交" class="Button"
					style="display: inline;" />
			</td>
			<td align="left">
				<input type="reset" value="重置" class="Button" />
			</td>
		</tr>

	</table>
</form>

<script>
dataMap.bean = {};
//alert('${bean}'=='');
dataMap.bean.totalLearnYear = '${bean.totalLearnYear}';
dataMap.bean.matriculationYear = '${bean.matriculationYear}';


</script>